package com.fsl.springbootdesignpattern.b_factory.abstract_factory;

import com.fsl.springbootdesignpattern.b_factory.simple_factory.Audi;
import com.fsl.springbootdesignpattern.b_factory.simple_factory.Benz;
import com.fsl.springbootdesignpattern.b_factory.simple_factory.Bmw;
import com.fsl.springbootdesignpattern.b_factory.simple_factory.Car;

public abstract class AbstractFactory {

    protected abstract Car getCar();

    public Car getCar(String name){
        switch (name)
        {
            case "Audi":
                return new Audi();
            case "Benz":
                return new Benz();
            case "Bmw":
                return new Bmw();
            default:
                return null;
        }
    }
}
